<? include 'server_config.php'; 
//include 'my_info_auth.php'; 


if($user_idx=="")
{
	
	?>
	<script>
		alert("권한이 없습니다.");
	</script>
	<?
	return;
}

?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<?


$sql = "

INSERT INTO ndd_disease_basic (user_idx, disease_idx, reg_timestamp, q1,q2,q3,q4,q5,q6,q7,q7_1,q7_2) VALUES 
( $user_idx, '$disease_idx', CURRENT_TIMESTAMP, '$q1', '$q2', '$q3', '$q4', '$q5', '$q6', '$q7', '$q7_1', '$q7_2' );
";

//echo $sql;
$result = mysql_query($sql,$connect);


$sql = "

UPDATE ndd_disease_basic SET q1 = '$q1', q2 = '$q2', q3 = '$q3', q4 = '$q4', q5 = '$q5', q6 = '$q6', q7 = '$q7', q7_1 = '$q7_1', q7_2 = '$q7_2'
 WHERE user_idx = $user_idx AND disease_idx = '$disease_idx';
";

//echo $sql;
$result = mysql_query($sql,$connect);

?>

<script> 
parent.location.reload();
</script>











